package com.jimet.process;

import java.util.Hashtable;

public class ListActionProcessController {

	private Hashtable<String, String> processNamesHash;
	
	public ListActionProcessController() {
		this.processNamesHash		= new Hashtable<String, String>();
		
		processNamesHash.put("USERS_LIST_TABLE", "com.fuskey.admin.process.listAction.UsersListActionProcess");
		processNamesHash.put("LOGOUT", "com.jimet.process.LogoutProcess");	
		processNamesHash.put("CONTACT_PAGE", "com.boun.process.listAction.ContactListActionProcess");	
		processNamesHash.put("CONTENT_PAGE", "com.boun.process.listAction.ContentListActionProcess");	
		processNamesHash.put("GALLERY_PAGE", "com.boun.process.listAction.GalleryListActionProcess");	
		processNamesHash.put("STATIC_CONTENT", "com.boun.process.listAction.ContentListActionProcess");	
		processNamesHash.put("PERSONAL_VISIT_PAGE", "com.boun.process.listAction.VisitAppListActionProcess");	
		processNamesHash.put("SCHOOL_VISIT_PAGE", "com.boun.process.listAction.VisitAppListActionProcess");	
		processNamesHash.put("MAIN_PAGE", "com.boun.process.listAction.MainContentListActionProcess");
		processNamesHash.put("GRAD_PAGE", "com.boun.process.listAction.MainContentListActionProcess");	
		processNamesHash.put("STUDENT_PAGE", "com.boun.process.listAction.MainContentListActionProcess");	
		processNamesHash.put("QUESTIONS_PAGE", "com.boun.process.listAction.ContactQuestionListActionProcess");
		processNamesHash.put("STATISTICS", "com.boun.process.listAction.StatisticListActionProcess");
		processNamesHash.put("COMPARE", "com.boun.process.listAction.CompareListActionProcess");
		processNamesHash.put("SLIDEGALLERY_PAGE", "com.boun.process.listAction.GalleryListActionProcess");	
		processNamesHash.put("VIDEO_PAGE", "com.boun.process.listAction.VideoGalleryListActionProcess");	
	}
	
	public String doProcess ( String strListName , String strAction , String objIds , Object paramObj ) throws Exception
	{
		String result 	= "";
		
		try {
			String strObjName				= (String)processNamesHash.get(strListName);
			ListActionProcessorBase proc	= new ListActionProcessorBase( strObjName );
			result							= proc.doProcess(strAction,objIds,paramObj);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		
		return result;
	}
	
	public boolean doValidate ( String strListName , String strAction , String objIds ) throws Exception
	{
		boolean result 	= true;
		
		try {
			String strObjName				= (String)processNamesHash.get(strListName);
			ListActionProcessorBase proc	= new ListActionProcessorBase( strObjName );
			result							= proc.doValidate(strAction,objIds);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		
		return result;
	}	
	
}
